package com.leo;

import com.leo.controller.SampleController;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.stage.Stage;

/**
 * @ClassName FxApplication
 * @Description 这里需要注意，使用相对路径时 需要在pom中配置，将静态资源拷贝过去；给button设置点击事件的几种方式
 * @Author wangss
 * @date 2020.06.20 23:27
 * @Version 1.0
 */
public class FxDefineApplication extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("view/define.fxml"));
        Parent root = fxmlLoader.load();

        Scene scene = new Scene(root);
        primaryStage.setScene(scene);
        primaryStage.setTitle("Hello Fxml");
        primaryStage.setWidth(800d);
        primaryStage.setHeight(800d);
        primaryStage.show();
    }
}
